import requests
import cve_searchsploit
import sys

cve_searchsploit.update_db()

vendor = "microsoft"
product = "edge"

r = requests.get("https://cve.circl.lu/api/search/%s/%s" % (vendor, product))
vulns = r.json()

exploits = set()
cve_with_exploits = 0

for v in vulns:
    ids = cve_searchsploit.edbid_from_cve(v["id"])
    for i in ids:
        exploits.add(i)
    if len(ids) > 0:
        cve_with_exploits += 1
        print("", v["id"], ":", ids)

print()
print(" Number of CVEs with an exploit in ExploitDB:", cve_with_exploits)
print(" Number of public exploits for Edge in ExploitDB:", len(exploits))
print()
